package com.ad.pet.app.mall.adapter;

import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ad.pet.R;
import com.ad.pet.models.remote.mall.Specification;

import java.util.List;

/**
 * Created by SEELE on 2019/5/14.
 */

public class DescribeGoodAdapter extends BaseQuickAdapter<Specification, BaseViewHolder> {
    public DescribeGoodAdapter(@Nullable List<Specification> data) {
        super(R.layout.item_good_detail_desc, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Specification item) {
        TextView textView = helper.getView(R.id.tv_name);

        if (TextUtils.isEmpty(item.getName())) {
            textView.setText(item.getValue());
        } else {
            textView.setText(item.getName() + ":" + item.getValue());
        }
    }
}
